/*******************************************************************
 File:     history.h
 Purpose:  Providing history support for things
 Author:   Justin Fletcher
 Date:     12 Jan 1997
 ******************************************************************/

/*********************************************** <c> Gerph *********
 Function:     history_create
 Description:  Create a history block
 Parameters:   maxlen = maximum length of the history, or 0 for
                        infinite
 Returns:      history handle, or NULL if could not create
 ******************************************************************/
void *history_create(int maxlen);


/*********************************************** <c> Gerph *********
 Function:     history_destory
 Description:  Destory a history block
 Parameters:   histv = history handle
 Returns:      none
 ******************************************************************/
void history_destroy(void *histv);


/*********************************************** <c> Gerph *********
 Function:     history_add
 Description:  Add a line to the buffer
 Parameters:   histv = history handle
               line = line to store
 Returns:      none
 ******************************************************************/
void history_add(void *histv,char *line);


/*********************************************** <c> Gerph *********
 Function:     history_previous
 Description:  returns the string previously added to the buffer
 Parameters:   histv = history handle
               last = last line returned, or NULL to start
 Returns:      pointer to line, or NULL if none
 ******************************************************************/
char *history_previous(void *histv,char *last);


/*********************************************** <c> Gerph *********
 Function:     history_next
 Description:  returns the string subsequently added to the buffer
 Parameters:   histv = history handle
               last = last line returned, or NULL to start
 Returns:      pointer to line, or NULL if none
 ******************************************************************/
char *history_next(void *histv,char *last);
